package com.ym.soso.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;


@EnumDescription("机构类别")
public enum CategoryEnum implements DictEnum {

    //--------------------start-----------------


    REST_HOUSE("01", "敬老院"),

    ELDERLY_HOSTEL("02", "老年公寓"),

    WELFARE_HOME("03", "福利院"),

    SANATORIUM("04", "疗养院"),

    AGING_COMMUNITY("05", "养老社区"),

    HOME_BASED_CARE("06", "居家养老"),

    AGED_CARE("07", "养老照料"),

    NURSING_HOME("08", "护理院"),
    OLD_NURSING_HOME("09", "养老院"),
    OTHER("10", "其他"),


    //--------------------end-------------------
    ;

    private String key;

    private String value;

    CategoryEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    /**
     * 序列化使用
     */
    public static class Covert extends StdConverter<String, JSONObject> {
        @Override
        public JSONObject convert(String value) {
            return DictEnum.valueOfJson(CategoryEnum.class, value);
        }
    }
}
